libtest.sh: only check whether $(pwd) is empty once
authorSimon McVittie <smcv@debian.org>
Thu, 31 Mar 2016 16:52:57 +0000 (17:52 +0100)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Thu, 31 Mar 2016 18:54:13 +0000 (18:54 +0000)
test-sysroot.js runs libtestExec() twice, one of which is after
creating non-hidden directories in $(pwd), so this check needs to be
skipped the second time.

Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #234
Approved by: cgwalters

tests/libtest.sh

index aaa553a0493078ffd90ebb953915878e1aa22c60..765e987dd9de95f06c9acb66f4bf720de15d6919 100755 (executable)
@@ -41,8 +41,12 @@ test_tmpdir=$(pwd)
 if ! test -f .testtmp; then
     files=$(ls)
     if test -n "${files}"; then
+       ls -l
        assert_not_reached "test tmpdir=${test_tmpdir} is not empty; run this test via \`make check TESTS=\`, not directly"
     fi
+    # Remember that this is an acceptable test $(pwd), for the benefit of
+    # C and JS tests which may source this file again
+    touch .testtmp
 fi
 
 export G_DEBUG=fatal-warnings